package com.meilai.project.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * @description 制作单-外单类型
 * @author 张驰
 * @date 2022/8/16 10:38
 */
@Getter
public enum AdMakeOutTypeEnum {
    NORMAL(1, "普通"),
    REPLACE(2, "换画");

    @EnumValue
    private final Integer id;
    private final String name;

    AdMakeOutTypeEnum(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static AdMakeOutTypeEnum getEnumById(Integer id) {
        for (AdMakeOutTypeEnum adMakeOutTypeEnum : AdMakeOutTypeEnum.values()) {
            if (adMakeOutTypeEnum.getId().equals(id)) {
                return adMakeOutTypeEnum;
            }
        }
        return null;
    }
}
